home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d5 / pmusic12.arc / SOUNDEFF.PAS < prev    next >
Pascal/Delphi Source File  |  1990-01-29  |  717b  |  38 lines

  1. program soundeffect;
  2.  
  3. { SoundEff.pas - Example program showing use of the tritone() function }
  4.  
  5. {$L ptrit_s}
  6. uses crt;
  7.  
  8. var v1, v2, v3 : word;
  9.  
  10. procedure tritone(t,a,b,c,d:word); external;
  11.  
  12. function NextVal(var A:word):word;
  13. begin
  14.   if A >= 8191 then
  15.       NextVal := 1
  16.   else
  17.       NextVal := A + 5;
  18. end;
  19.  
  20. function PrevVal(var A:word):word;
  21. begin
  22.   if A <= 1 then
  23.       PrevVal := 8191
  24.   else
  25.       PrevVal := A - 5;
  26. end;
  27.  
  28. begin
  29.     write('Press any key to quit... ');
  30.    v1 := 1; v2 := 4050; v3 := 8191;
  31.    while not ( KeyPressed ) do begin
  32.       tritone( 512, v1, v2, v3, 6 );
  33.       v1 := NextVal(v1);
  34.       v2 := PrevVal(v2);             
  35.       v3 := PrevVal(v3);             
  36.    end;
  37. end.
  38.